package labox.innovation.loginserver.socket.clientpackets;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import labox.innovation.config.Config;
import labox.innovation.loginserver.socket.LoginClient;
import labox.innovation.netcore.ReceivablePacket;

/**
 * 
 * @author KenM
 */
public abstract class LoginClientPacket extends ReceivablePacket<LoginClient> {

	private static Logger _log = LoggerFactory.getLogger(LoginClientPacket.class.getName());

	public static final int PTL_AUTHGAMEGUARD = 0x00;

	public static final int PTL_CLIENTREGISTERPACKET = PTL_AUTHGAMEGUARD + 0x01;

	public static final int PTL_REQUESTAUTHLOGIN = PTL_AUTHGAMEGUARD + 0x02;
	
	public static final int PTL_REQUESTCHANGEPASSWORD = PTL_AUTHGAMEGUARD + 0x03;
	
	public static final int PTL_REQUESTBINDPHONENO = PTL_AUTHGAMEGUARD + 0x04;

	/**
	 * @see com.l2jserver.mmocore.network.ReceivablePacket#read()
	 */
	@Override
	protected final boolean read() {
		try {
			readImpl();
			return true;
		} catch (Exception e) {
			_log.error("ERROR READING: " + this.getClass().getSimpleName(), Config.SERVER_ID, e);
			e.printStackTrace();
		}
		return false;
	}

	protected abstract void readImpl();
}
